package com.du.common.controller;

import com.wf.captcha.utils.CaptchaUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
public class CommonController {


    @GetMapping("/login")
    public String login(){
        return "login";
    }


    @GetMapping("/index")
    public String index(){
        return "index";
    }

    @GetMapping("/welcome")
    public String welcome(){
        return ("welcome");
    }
    @GetMapping("/luogu")
    public String luogu(){
        return ("redirect:https://www.luogu.com.cn");
    }
    @GetMapping("/bilibili")
    public String bilibili(){
        return ("redirect:https://www.bilibili.com/");
    }
    @GetMapping("/qianduan")
    public String qianduan(){
        return ("redirect:https://www.bilibili.com/video/BV1Sy4y1C7ha?share_source=copy_web");
    }@GetMapping("/houduan")
    public String houduan(){
        return ("redirect:https://www.bilibili.com/video/BV1Kb411W75N?share_source=copy_web");
    }
    @GetMapping("/yszd")
    public String yszd(){
        return ("yszd");
    }


    @RequestMapping("/captcha")
    public void captcha(HttpServletRequest request, HttpServletResponse response) throws Exception {
        CaptchaUtil.out(request,response);
    }
}
